package com.jida.tijian.controller;

import com.jida.tijian.dto.ResponseObject;
import com.jida.tijian.service.HospitalService;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RestController;

@RestController
public class HospitalController {

    //1.Controller 要调用 service
    @Autowired
    HospitalService hospitalService;

    //获取所有状态 正常的医院数据 2.接收前端的请求
    @RequestMapping("/hospital")
    public ResponseObject listHospital() {//该方法获取医院列表
        //return null;//写到这去mapper写

        //返回给前端的对象 调用业务层的方法 该方法返回的是ResponseObject 并且内容是一个列表
        return hospitalService.listHospital();
    }
}
